import request from '@/api/request';

/**
 * 分页
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const flowFormPageApi = query => {
    return request({
        url: '/api/flow/form/page',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 启用的列表
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const flowFormListEnabledApi = query => {
    return request({
        url: '/api/flow/form/listEnabled',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 详情
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const flowFormDetailApi = query => {
    return request({
        url: '/api/flow/form/getDetail',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 添加
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const flowFormSaveApi = query => {
    return request({
        url: '/api/flow/form/save',
        method: 'post',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const flowFormEditApi = query => {
    return request({
        url: '/api/flow/form/edit',
        method: 'put',
        data: query,
        isLoading: true
    });
};


/**
 * 编辑状态
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const flowFormEditStatusApi = query => {
    return request({
        url: '/api/flow/form/editStatus',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 编辑设为内置
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const flowFormEditBuildInApi = query => {
    return request({
        url: '/api/flow/form/editBuildIn',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 删除
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const flowFormRemoveApi = query => {
    return request({
        url: '/api/flow/form/removeByIds',
        method: 'delete',
        params: query,
        isLoading: true
    });
};
